/* 任务详情页面 - 重构版 */

.task-detail {
  padding: 24px;
  background: #f5f7fa;
  min-height: 100vh;
  max-width: 1400px;
  margin: 0 auto;
}

/* 页面头部样式 */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 16px;
  padding: 24px 32px;
  margin-bottom: 32px;
  color: white;
  box-shadow: 0 8px 32px rgba(102, 126, 234, 0.2);
  position: relative;
  overflow: hidden;
  gap: 24px;
}

/* 特定选择器样式 - 确保标题为白色 */
#root > div > div > main > div > header > div.header-content > h2 {
  color: #ffffff !important;
}

.page-header::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 200px;
  height: 200px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  transform: scale(2);
  pointer-events: none;
}

/* 主体内容样式 */
.main-content {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

/* Section通用样式 */
.section-execution,
.section-scan-results {
  background: white;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  transition: all 0.3s ease;
}

.section-execution:hover,
.section-scan-results:hover {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

/* Section头部样式 */
.section-header {
  background: linear-gradient(135deg, #fafbfc 0%, #f0f2f5 100%);
  border-bottom: 2px solid #e8f4f8;
  padding: 20px 24px;
  margin-bottom: 0;
}

.section-header .ant-typography {
  margin: 0;
}

.section-header h3 {
  color: #1890ff;
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 4px;
}

.section-header .ant-typography.ant-typography-caption {
  font-size: 13px;
  color: #666;
  margin: 0;
}

/* 第一部分：任务执行信息 */
.section-execution {
  border-left: 4px solid #52c41a;
}

.section-execution .section-header {
  background: linear-gradient(135deg, #f6ffed 0%, #ffffff 100%);
}

.section-execution .section-header h3 {
  color: #52c41a;
}

/* 第二部分：扫描结果 */
.section-scan-results {
  border-left: 4px solid #fa8c16;
}

.section-scan-results .section-header {
  background: linear-gradient(135deg, #fff7e6 0%, #ffffff 100%);
  border-bottom: 2px solid #ffe7ba;
}

.section-scan-results .section-header h3 {
  color: #fa8c16;
}

/* 子区域样式 */
.sub-section-statistics {
  background: #fafbfc;
  border-radius: 12px;
  margin: 24px;
  padding: 20px;
  border: 1px solid #f0f2f5;
  transition: all 0.3s ease;
}

.sub-section-statistics:hover {
  background: #f8f9fb;
  border-color: #e8f4f8;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.sub-section-problems {
  background: #fafbfc;
  border-radius: 12px;
  margin: 24px;
  padding: 20px;
  border: 1px solid #f0f2f5;
  transition: all 0.3s ease;
}

.sub-section-problems:hover {
  background: #f8f9fb;
  border-color: #e8f4f8;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.sub-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid #f0f0f0;
}

.sub-section-header .ant-typography {
  margin: 0;
}


/* 内容区域样式 */
.section-execution .ant-row {
  /* 执行信息内容样式由组件控制 */
}

.sub-section-statistics > :not(.sub-section-header),
.sub-section-problems > :not(.sub-section-header),
.pending-content > :not(.section-header) {
  /* 内容样式由各组件内部控制 */
}

/* 无问题和待处理结果容器 */
.no-problems-container,
.pending-results-container {
  padding: 60px 24px;
  text-align: center;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 12px;
  margin: 24px;
}

/* 问题清单部分 */
.problem-list-section {
  margin: 24px;
}

.problem-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding: 16px 20px;
  background: linear-gradient(135deg, #f0f9ff 0%, #e6f7ff 100%);
  border-radius: 12px;
  border-left: 4px solid #1890ff;
}

.problem-list-header h4 {
  color: #1890ff;
  font-weight: 600;
  margin: 0;
}

/* 按钮样式 */
.back-button {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  border-radius: 10px;
  transition: all 0.3s ease;
}

.back-button:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.5);
  color: white;
  transform: translateY(-2px);
}

.header-content {
  flex: 1;
  text-align: center;
  z-index: 1;
}

.header-actions {
  z-index: 1;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.action-button {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  border-radius: 8px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.action-button:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.5);
  color: white;
  transform: translateY(-2px);
}

.action-button.ant-btn-primary {
  background: rgba(255, 255, 255, 0.9);
  color: #667eea;
  font-weight: 600;
}

.action-button.ant-btn-primary:hover {
  background: white;
  color: #5a67d8;
}

/* 危险按钮（取消任务）的特殊样式 */
.action-button.ant-btn-dangerous,
.action-button.ant-btn-danger {
  background: rgba(255, 77, 79, 0.15) !important;
  border-color: rgba(255, 77, 79, 0.6) !important;
  color: #ff4d4f !important;
  font-weight: 500;
}

.action-button.ant-btn-dangerous:hover,
.action-button.ant-btn-danger:hover {
  background: #ff4d4f !important;
  border-color: #ff4d4f !important;
  color: white !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 77, 79, 0.4);
}

.action-button.ant-btn-dangerous:focus,
.action-button.ant-btn-danger:focus {
  background: #ff4d4f !important;
  border-color: #ff4d4f !important;
  color: white !important;
}

.action-button.ant-btn-dangerous:active,
.action-button.ant-btn-danger:active {
  background: #d9363e !important;
  border-color: #d9363e !important;
  color: white !important;
}

/* 执行信息内容样式 */
.execution-content {
  padding: 24px;
}

.task-title {
  color: #ffffff;
  margin: 0 0 16px 0;
  font-size: 28px;
  font-weight: 600;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.task-meta {
  opacity: 0.9;
}

.task-id,
.created-time {
  color: rgba(255, 255, 255, 0.9);
  font-size: 14px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}
/* 加载和空状态容器 */
.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 0;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 12px;
  backdrop-filter: blur(10px);
}

.empty-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 100px 0;
  background: white;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* 动画效果 */
.section-execution { 
  animation: fadeInUp 0.6s ease-out;
  animation-delay: 0s; 
}

.section-scan-results { 
  animation: fadeInUp 0.8s ease-out;
  animation-delay: 0.2s; 
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 响应式设计 */
@media (max-width: 1400px) {
  .task-detail {
    max-width: 100%;
    padding: 20px;
  }
  
  .main-content {
    gap: 32px;
  }
}

/* 桌面端 (>1200px) - 符合设计要求 */
@media (min-width: 1200px) {
  .section-execution .execution-content {
    display: flex;
  }
  
  .section-execution .execution-content .task-execution-info {
    width: 100%;
  }
}

/* 平板端 (768-1200px) - 符合设计要求 */
@media (max-width: 1200px) {
  .page-header {
    flex-direction: column;
    gap: 20px;
    text-align: center;
  }
  
  .header-content {
    order: -1;
  }
  
  .back-button {
    align-self: flex-start;
  }
  
  .header-actions {
    width: 100%;
    text-align: center;
  }
  
  .main-content {
    gap: 28px;
  }
  
  /* 合并执行信息和操作 */
  .section-execution .execution-content {
    display: flex;
    flex-direction: column;
  }
}

/* 手机端 (<768px) - 符合设计要求 */
@media (max-width: 768px) {
  .task-detail {
    padding: 16px;
  }
  
  .page-header {
    padding: 20px;
    margin-bottom: 24px;
    flex-direction: column;
    gap: 16px;
  }
  
  .task-title {
    font-size: 22px;
  }
  
  .task-meta {
    flex-direction: column;
    gap: 8px;
  }
  
  .header-actions {
    width: 100%;
  }
  
  .action-button {
    width: auto;
    min-width: 60px;
  }
  
  .main-content {
    gap: 24px;
  }
  
  .section-header {
    padding: 16px 20px;
  }
  
  .execution-content {
    padding: 20px;
  }
  
  .sub-section-statistics,
  .sub-section-problems {
    margin: 20px;
    padding: 16px;
  }
  
  .problem-list-section {
    margin: 20px;
  }
  
  .problem-list-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 12px 16px;
  }
  
  /* 折叠统计信息卡片 */
  .task-statistics .statistics-card {
    margin-bottom: 12px;
  }
  
  /* 简化扫描结果 */
  .section-results .ant-table-wrapper {
    overflow-x: auto;
  }
}

@media (max-width: 576px) {
  .task-detail {
    padding: 12px;
  }
  
  .page-header {
    padding: 16px;
    margin-bottom: 20px;
  }
  
  .task-title {
    font-size: 20px;
  }
  
  .main-content {
    gap: 20px;
  }
  
  .section-header {
    padding: 12px 16px;
  }
  
  .section-header h3 {
    font-size: 16px;
  }
  
  .section-execution .ant-row,
  .sub-section-statistics,
  .sub-section-problems {
    padding: 12px;
    margin: 16px;
  }
}

/* 滚动条美化 */
.task-detail::-webkit-scrollbar {
  width: 6px;
}

.task-detail::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.task-detail::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #667eea, #764ba2);
  border-radius: 3px;
}

.task-detail::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #5a67d8, #6b46c1);
}